using System;
using Volo.Abp.Domain.Entities;

namespace ERP.Team.ProductionSystem
{
    /// <summary>
    /// 物料需求实体--bpy
    /// </summary>
    public class MaterialRequirementModel : Entity<int>
    {
        /// <summary>
        /// 关联的客户订单ID
        /// </summary>
        public int CustomerOrderId { get; set; }

        /// <summary>
        /// 父级需求ID（用于构建层级结构，顶级为0）
        /// </summary>
        public int ParentId { get; set; }

        /// <summary>
        /// 层级级别（1、2、3...）
        /// </summary>
        public int Level { get; set; }

        /// <summary>
        /// 是否为层级标题（true-层级标题，false-具体物料）
        /// </summary>
        public bool IsLevelTitle { get; set; }

        /// <summary>
        /// 层级标题名称（如"第一层"、"第二层"）
        /// </summary>
        public string LevelTitle { get; set; }

        /// <summary>
        /// 物料编码（关联MaterialproductModel.MaterielCode）
        /// </summary>
        public string MaterialCode { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        public string MaterialName { get; set; }

        /// <summary>
        /// 规格型号
        /// </summary>
        public string Specifications { get; set; }

        /// <summary>
        /// 需求数量
        /// </summary>
        public decimal RequiredQuantity { get; set; }

        /// <summary>
        /// 库存数量
        /// </summary>
        public decimal InventoryQuantity { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 排序序号
        /// </summary>
        public int SortOrder { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public string CreateUser { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 更新人
        /// </summary>
        public string UpdateUser { get; set; }

        /// <summary>
        /// 是否已删除
        /// </summary>
        public bool IsDeleted { get; set; }

        /// <summary>
        /// 构造函数
        /// </summary>
        public MaterialRequirementModel()
        {
            CreateTime = DateTime.Now;
            IsDeleted = false;
            ParentId = 0;
            Level = 1;
            SortOrder = 0;
            RequiredQuantity = 0;
            InventoryQuantity = 0;
        }
    }
} 